var vue = new Vue({
  el: '.app',
  data: {
    name: 'zt',
    isLogin: '',
    visible: false,
    numberValidateForm: {
      name: '',
      pass: '',
    }
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          axios.get('/login', {
            params: {
              name: this.numberValidateForm.name,
              pass: this.numberValidateForm.pass,
            }
          }).then((res) => {
            console.log(res.data);
            if (res.data.code === 0) {
              this.isLogin = res.data.data.who;
              window.location.reload();
            }
          });
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
});
